package com.wn.project.mapper;

import cn.hutool.core.util.StrUtil;
import com.wn.entity.Document;
import com.wn.entity.Procedure;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.jdbc.SQL;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: pms
 * @InterfaceName DocumentMapper
 * @description:
 * @author: LRW
 * @create: 2022-10-25 14:55
 * @Version 1.0
 **/
public interface DocumentMapper {
    /***
     * @description: 新增项目文档
     * @param: document
     * @return: void
     * @author Lrw
     * @date: 2022/10/20 10:46
     */
    @Insert("insert into pms_document(no,project_id,name,version,author,time,path) values(#{no},#{projectId},#{name},#{version},#{author},#{time},#{path})")
    void add(Document document);

    /***
     * @description: 根据id删文档
     * @param: id
     * @return: void
     * @author Lrw
     * @date: 2022/10/20 10:47
     */
    @Delete("delete from pms_document where id=#{id}")
    void deleteById(int id);

    /***
     * @description: 根据id查文档
     * @param: id
     * @return: com.wn.entity.Document
     * @author Lrw
     * @date: 2022/10/25 15:26
     */
    @Select("select * from pms_document where id=#{id}")
    Document selectById(int id);

    /***
     * @description: 条件查询
     * @param: document
     * @return: java.util.List<com.wn.entity.Document>
     * @author Lrw
     * @date: 2022/10/26 17:20
     */
    List<Document> selectByCondition(Document document);

    /***
     * @description: 条件更新
     * @param: document
     * @return: void
     * @author Lrw
     * @date: 2022/10/25 15:25
     */
    void update(Document document);

}
